<?php

/**
 * 设置相关
 * 
 * @author ShuangYa
 * @package Blog
 * @category Library
 * @link http://www.sylingd.com/
 * @copyright Copyright (c) 2015 ShuangYa
 * @license http://lab.sylingd.com/go.php?name=blog&type=license
 */

namespace blog\libs;
use \sy\lib\db\YMysql;
use \sy\lib\YHtml;

class option {
	/**
	 * Set
	 * @access public
	 * @param string $k
	 * @param string $v
	 */
	public static function set($k, $v) {
		$v = addslashes($v);
		$sql = "UPDATE `#@__option` SET v = '$v' WHERE k = ?";
		YMysql::i()->query('option', $sql, [$k]);
	}
	/**
	 * Get
	 * @access public
	 * @param string $k
	 */
	public static function get($k) {
		$r = YMysql::i()->getOne("SELECT v FROM `#@__option` WHERE k = ?", [$k]);
		return stripslashes($r['v']);
	}
}